UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '71S9AyfHqBGanNQ7J3e3Ys3cmKSU4NxO9FJLK8ItlJY=' 
WHERE 
  key_id = 'caac659ddc7028d8d97bd17067f9c750cda5e801704919e16144d061e4329bda' 
  AND (
    token = '71S9AyfHqBGanNQ7J3e3Ys3cmKSU4NxO9FJLK8ItlJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039