UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e2cGcoR48wV6E+Pj+AYm3jspCFmJKqd0WjpI2+8DjMk=' 
WHERE 
  key_id = '3552603b82924f1a351174ee2f67d5e9c3cae9b8947902ce7f40c45996ec2799' 
  AND (
    token = 'e2cGcoR48wV6E+Pj+AYm3jspCFmJKqd0WjpI2+8DjMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036