UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oCRkNwfvjB4f9T+zZm6C5v/yoZmAkoW6SZrenAQafL4='
WHERE
key_id = '0271a0b032a19e2fa5035455f66b3c9665faec543d90244d8d5ce33f2f8f9dad'
AND (
token = 'oCRkNwfvjB4f9T+zZm6C5v/yoZmAkoW6SZrenAQafL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)