UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lEyqS8BE7RxTv8a77JFTMoF2+E+ErsrXp1GYq3x9CDg='
WHERE
key_id = '2ca0184620ca90df6d2d79a2dc0bb1a0ccab733cb637007b0270ebd5999b66c8'
AND (
token = 'lEyqS8BE7RxTv8a77JFTMoF2+E+ErsrXp1GYq3x9CDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)