UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wnn2v7PMJpmnOlLSxltl4JepAAZaHtdBNWYu8OgKUac='
WHERE
key_id = '3cccd7d934e230ff7040bf3f9aeee3239d472b7815f29e716d3b001f3c1c7477'
AND (
token = 'wnn2v7PMJpmnOlLSxltl4JepAAZaHtdBNWYu8OgKUac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)