UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x1Kgd9xG8vFawTH4oaUo7IU8OfXR1aqgJcWoZOo36wY=' 
WHERE 
  key_id = 'e6484e2e5ef6b98156ad7f15818b8891059c22686c696a8fc85a3c34a2d4fdaa' 
  AND (
    token = 'x1Kgd9xG8vFawTH4oaUo7IU8OfXR1aqgJcWoZOo36wY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030