UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gnY114Txzr/B/h2ua4QKd/uTW01sfs5WtSoMinlLhEg=' 
WHERE 
  key_id = '0e9de9c35463955adb61f59db8a00189c5678d4cf10f0afae2a047d3051b518b' 
  AND (
    token = 'gnY114Txzr/B/h2ua4QKd/uTW01sfs5WtSoMinlLhEg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031