UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DAxj1nmR5l646rbrPztQQlqi8gW7k1RD50k3ADOo1uo='
WHERE
key_id = '85559672986fd4c2f1cda9d79793491f37d643eb0dd91ac619d3eab87a43b450'
AND (
token = 'DAxj1nmR5l646rbrPztQQlqi8gW7k1RD50k3ADOo1uo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)