UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'omDXTNNrcI3JbeIWmcZ5bMcJj4Lpp4K3Vb2BhQX+lsk='
WHERE
key_id = '875f49a3aa4a1fd05a56c7d95b0430b88abbf29031c446e17a6760ab0141cc06'
AND (
token = 'omDXTNNrcI3JbeIWmcZ5bMcJj4Lpp4K3Vb2BhQX+lsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)