UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N4/2Ii/K8ZW8RnJYnZwyCCoLOvnVbAfQHGmJz90Zeuk=' 
WHERE 
  key_id = '0a9228d9ef86e3d023583ce58a1c205f3420b951720ce655f7a2d44f1a1e48e4' 
  AND (
    token = 'N4/2Ii/K8ZW8RnJYnZwyCCoLOvnVbAfQHGmJz90Zeuk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029