UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xKciWEdVFbDs8j0SG/sjtbFNh5OeWgi9/9rf/RLf5+Y='
WHERE
key_id = 'b0985bca91fd505fdebd9e89162793d61b4e95c99161544f35ae693c530e3d7b'
AND (
token = 'xKciWEdVFbDs8j0SG/sjtbFNh5OeWgi9/9rf/RLf5+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)