UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bapdXq2BhDEFrZuW20fXJFUrkCdK+9ZwFG1zDXtHUpQ='
WHERE
key_id = 'c1ee7e732c6dccc46be0c8dd44c7f6c080ec28fdba28c02691e9b7c3be29946c'
AND (
token = 'bapdXq2BhDEFrZuW20fXJFUrkCdK+9ZwFG1zDXtHUpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)