UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FjXnPzPa6k8R43eQjDgPZamI2KoPu7vJzZEoBOyoTJA=' 
WHERE 
  key_id = '012a0614e15ea535775a01327b1a979b753b313c994fcec8ef98bd0a00cc23c8' 
  AND (
    token = 'FjXnPzPa6k8R43eQjDgPZamI2KoPu7vJzZEoBOyoTJA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045