UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IRb6Wg9GVcYCT3O/K4Q4CnDt3PZtjFILYx6dF9k+yps=' 
WHERE 
  key_id = 'aa9f7d38d70f4129e3aa36276a0ee77769e3c4eb96126c8f7e7b8a633d3478e1' 
  AND (
    token = 'IRb6Wg9GVcYCT3O/K4Q4CnDt3PZtjFILYx6dF9k+yps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037