UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43WOUkFwHqPAdWuFW/NUa2DIiygt1yw/ID+LDk+KT/Y='
WHERE
key_id = '52e03b423569efc100276486a974e4b6d020fda9f81217e47520cc03a497f746'
AND (
token = '43WOUkFwHqPAdWuFW/NUa2DIiygt1yw/ID+LDk+KT/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)