UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G63q+4syx68KrfyV0cRo9hfy/trsmeK3CW95r5jS74k='
WHERE
key_id = 'fa70876f91dc427ed9eb4f6abb20acc4faff83668b608861f16b936d3a254250'
AND (
token = 'G63q+4syx68KrfyV0cRo9hfy/trsmeK3CW95r5jS74k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)