UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uQ75kUzrTGi8AkW//bhEJ55Iv3KSL6lVi9N1dHvj+i4='
WHERE
key_id = 'b0bda3eeafe38f8d5e564ac62ea650cfd16292c8aeae22fb66264e9a1aea31f3'
AND (
token = 'uQ75kUzrTGi8AkW//bhEJ55Iv3KSL6lVi9N1dHvj+i4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)