UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O71pNoXE1Zq/FcyH7R24c8R5o/Z2TlKARCOl4DwiUfY='
WHERE
key_id = 'fe2b3e61e19930253076ba14be16a0bdc6ecd39de65c08fa748446c863098c8a'
AND (
token = 'O71pNoXE1Zq/FcyH7R24c8R5o/Z2TlKARCOl4DwiUfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)