UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gC0yNi+YfbvcMCrlHmReHwy5c53OL3LUiGfFk9eGqMI='
WHERE
key_id = '8b0faea15228c908f0768a34b2d5af9dac20ecf11f0afdc817841d685c79d66f'
AND (
token = 'gC0yNi+YfbvcMCrlHmReHwy5c53OL3LUiGfFk9eGqMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)