UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IHN9trSEfGRyOLLjxWGpbvtWJy8C3EjUnMzm9/nQvVY=' 
WHERE 
  key_id = '918159456ca85cf6030dedaf05a08c472ddf89cfd78b6c441a1ab9c2b01d83e1' 
  AND (
    token = 'IHN9trSEfGRyOLLjxWGpbvtWJy8C3EjUnMzm9/nQvVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027