UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kUeg8NZRJRa0KkyAjdlDBR5TFkCdpQwWsSrqVSpQVPc=' 
WHERE 
  key_id = '88c4a244cefe06bcacb0db4d871a6691d665ab13285f021189861d7e11414367' 
  AND (
    token = 'kUeg8NZRJRa0KkyAjdlDBR5TFkCdpQwWsSrqVSpQVPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014