UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rlFI28I2MD2Byc/0U7hG5/V8Z5QoduN5mU/3kdtixg8=' 
WHERE 
  key_id = '737d58a8431b2cccce3dc315b180a85521017a4b587486766aaeec752a9bb312' 
  AND (
    token = 'rlFI28I2MD2Byc/0U7hG5/V8Z5QoduN5mU/3kdtixg8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027