UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BiFZabIZzC9FCPIDCOiL5ObOq1OwIcgWqgHT4GHTw4U='
WHERE
key_id = 'ea4f059bf2fcfd4abe05ad3e8d85d9c559e2ce239fd1eec9aa4050b3e178ccb2'
AND (
token = 'BiFZabIZzC9FCPIDCOiL5ObOq1OwIcgWqgHT4GHTw4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)