UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nhnIkteHM1mfnC00OJZBHWL+jwTpb6ZOVEpO3kSRVzU=' 
WHERE 
  key_id = '68e8c1cea90a7cf2dbe619783fa071708a65a1866b9e98dc039a34d6e41002d5' 
  AND (
    token = 'nhnIkteHM1mfnC00OJZBHWL+jwTpb6ZOVEpO3kSRVzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00091