UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/R3uPUGwKPOx/gHs1bAwb4QLreewImiOh0P0YQBq9IE='
WHERE
key_id = 'b4c761612844da781525b1c7c1430d99c8f1b4e1dd85950538df2854074cd0fc'
AND (
token = '/R3uPUGwKPOx/gHs1bAwb4QLreewImiOh0P0YQBq9IE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)