UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WcCNMPQdfWqnmwBBiwCFgPw/4DhuBCMsLpxKluKv6K4=' 
WHERE 
  key_id = 'd3c3b470f7d474152d257ecf8db22412697d45623cb96a59aea6cc57719fb9e4' 
  AND (
    token = 'WcCNMPQdfWqnmwBBiwCFgPw/4DhuBCMsLpxKluKv6K4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038