UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oIZZWO40YUg5nEXm1km8EO/ELvsKWXUgBTqLm7whv+A=' 
WHERE 
  key_id = 'b39bf4639879e5e802a6f9ea72572add1a3ac6311f4ab1f6e6093c8818db7308' 
  AND (
    token = 'oIZZWO40YUg5nEXm1km8EO/ELvsKWXUgBTqLm7whv+A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014