UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P+C8xeSwJBnoQ3/sPzZK8ICF8O9sitU/bDkAwM2kWUo=' 
WHERE 
  key_id = 'b2d3990a1bdeb89ace1c6c418d5f6d4c3244e23670e7401c25ca2c9986ecd793' 
  AND (
    token = 'P+C8xeSwJBnoQ3/sPzZK8ICF8O9sitU/bDkAwM2kWUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038