UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fMvPP8wh9SBNuvi5ko93XT9OkcDfLVSIoHBkaDNnsBI='
WHERE
key_id = '07c941a3cf3a560aeeb195f9118a0a97bcaa08fc7c259a935397c0b855d7deeb'
AND (
token = 'fMvPP8wh9SBNuvi5ko93XT9OkcDfLVSIoHBkaDNnsBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)