UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/XLZdTnKauAQMADnX0IyFaAeM7NutVTCn2Y10w2TWEE='
WHERE
key_id = '35edd1242973457fcdbcc1c00b5987f888dec945a46b78376ffec1729d1873a9'
AND (
token = '/XLZdTnKauAQMADnX0IyFaAeM7NutVTCn2Y10w2TWEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)