UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yVfRdko17KSF+C95UeAK3OEEKl/JU3UwfaBogub5x7I='
WHERE
key_id = '6b6ced20d8d6d5c43e20db84c43e0aa731cd0dcaebb299d1e446fbdbd4200a4f'
AND (
token = 'yVfRdko17KSF+C95UeAK3OEEKl/JU3UwfaBogub5x7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)