UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kEq54IWSGwZg1ieK7EOUlQ7Rp+WdLjwj/OYC4D1m6xU=' 
WHERE 
  key_id = '68e4b54abdef8f9716bfbeab704e2f8646f88f3ffaa9aeebdbb8f8dc3e62dad4' 
  AND (
    token = 'kEq54IWSGwZg1ieK7EOUlQ7Rp+WdLjwj/OYC4D1m6xU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053