UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EGxJCKB4xHNOPA/Z0LEXa/QxG4I55Gq75mOa02LRQN4='
WHERE
key_id = '06eef7bce0a3e4aed902f4e1b3078ad412ae34115e69be9b9f96bf1d72106a4e'
AND (
token = 'EGxJCKB4xHNOPA/Z0LEXa/QxG4I55Gq75mOa02LRQN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)