UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zQJ7WmeBxlU9OPRNkXDcaMabKv6J7aQaZ1IYKGFkth8='
WHERE
key_id = '0880656a591a9719a21f0342968f81343f1166d1c80077da1e2ae6255c39eefa'
AND (
token = 'zQJ7WmeBxlU9OPRNkXDcaMabKv6J7aQaZ1IYKGFkth8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)