UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MvP4j9Dxrao5p4kF5r5hXY/zcM5IYPAMyXQ+N+L5irI=' 
WHERE 
  key_id = '2dbf590cd1c04783613c7f68b299dcc186680f2e7845309a6cc1da37b10ef518' 
  AND (
    token = 'MvP4j9Dxrao5p4kF5r5hXY/zcM5IYPAMyXQ+N+L5irI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038