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

Query time 0.00044