UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AMplUR9x3Zz9hKkUeEdCzv0S6C9CCxWycVZgRscgKCs=' 
WHERE 
  key_id = 'ffa673c916c76cba4c6a4a7711b5879970bbbfd18c9d818662650f21efd1f522' 
  AND (
    token = 'AMplUR9x3Zz9hKkUeEdCzv0S6C9CCxWycVZgRscgKCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019