UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z3ozonaujMnymXkDlM5JtEgWLG4cnTw5CGVQIh/bKX4='
WHERE
key_id = '7e8a356fa533674ac50ae388a589107be47682d368dd4f56f894e27427893d1b'
AND (
token = 'Z3ozonaujMnymXkDlM5JtEgWLG4cnTw5CGVQIh/bKX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)