UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nW/z5/O+Dv0UJkbiw2rbkYPakmgCGm6rXmo3qVTjDO8='
WHERE
key_id = '93ac0703903fd5073151f4778dbf67fca2d580e29d1ace8f62dc47c074bcf358'
AND (
token = 'nW/z5/O+Dv0UJkbiw2rbkYPakmgCGm6rXmo3qVTjDO8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)