UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FxJ/G40hPnqMcvyeIYXZUynnjVcTyuvg/QS+bPoCMi4='
WHERE
key_id = 'd3d557263a002987a951fdd10635845c6ac25c42c21c76455e3b8601f08999bf'
AND (
token = 'FxJ/G40hPnqMcvyeIYXZUynnjVcTyuvg/QS+bPoCMi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)